Skip to content

fix(bridge): fix test isolation for nudge_counter test#365

Open
fagemx wants to merge 1 commit intomainfrom
fix/nudge-counter-test-isolation-348
Open

fix(bridge): fix test isolation for nudge_counter test#365
fagemx wants to merge 1 commit intomainfrom
fix/nudge-counter-test-isolation-348

Conversation

@fagemx
Copy link
Copy Markdown
Owner

@fagemx fagemx commented Mar 27, 2026

Summary

  • Fixes [bug] Failing test: nudge_counter returns 60 instead of 1 #348: post_tool_use_increments_nudge_counter test fails because stale nudge_ts files from previous runs cause cooldown suppression, preventing nudge emission.
  • Added fs::remove_dir_all cleanup before ensure_dirs in three tests: post_tool_use_cooldown_suppresses, post_tool_use_increments_nudge_counter, and post_tool_use_increments_decide_counter.
  • This matches the pattern already used by counter_increment_and_read (line 1030).

Test plan

  • cargo test -p edda-bridge-claude --lib -- post_tool_use_increments_nudge_counter passes
  • cargo test -p edda-bridge-claude --lib -- post_tool_use_cooldown_suppresses passes
  • cargo test -p edda-bridge-claude --lib -- post_tool_use_increments_decide_counter passes

🤖 Generated with Claude Code

Add fs::remove_dir_all before ensure_dirs in three dispatch tests
to clean up stale state from previous runs. Without this, leftover
nudge_ts files cause cooldown checks to suppress nudge emission,
making the test fail with "should produce nudge" assertion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Failing test: nudge_counter returns 60 instead of 1

1 participant